package cn.gong.movie.bean;

import java.util.Arrays;

import android.text.TextUtils;
import framework.base.BaseBean;

public class Drama extends BaseBean {
	private long id;
	private String name;
	private String date;
	private int status;// 0 follow 1 want 2 seen
	private int totalNum;
	private boolean[] episodes;
	private long watchTime;
	private int seenNum;
	
	public Drama(){
		
	}

	public Drama(String name, String date, int status, int totalNum, boolean[] episodes, int seenNum) {
		super();
		this.name = name;
		this.date = date;
		this.status = status;
		this.totalNum = totalNum;
		this.episodes = episodes;
		this.seenNum = seenNum;
	}

	@Override
	public String toString() {
		return "Drama [id=" + id + ", name=" + name + ", date=" + date + ", status=" + status + ", totalNum=" + totalNum + ", episodes=" + Arrays.toString(episodes) + ", watchTime=" + watchTime + ", seenNum=" + seenNum + "]";
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getTotalNum() {
		return totalNum;
	}

	public void setTotalNum(int totalNum) {
		this.totalNum = totalNum;
	}

	public long getWatchTime() {
		return watchTime;
	}

	public void setWatchTime(long watchTime) {
		this.watchTime = watchTime;
	}

	public String getEpisodeStr() {
		String str = "";

		for (int i = 0; i < this.episodes.length; i++) {
			if (episodes[i]) {
				str += (i + 1) + ",";
			}
		}

		if (!TextUtils.isEmpty(str)) {
			str = str.substring(0, str.length() - 1);
		}

		log("getEpisodeStr:" + str);

		return str;
	}

	public boolean[] getEpisodes() {
		return episodes;
	}

	public void setEpisodes(boolean[] episodes) {
		this.episodes = episodes;
	}

	public int getSeenNum() {
		return seenNum;
	}

	public void setSeenNum(int seenNum) {
		this.seenNum = seenNum;
	}

	public boolean isSeen() {
		return this.seenNum == this.totalNum;
	}

}
